<?php
/**
 * AD main driver
 *
 * This is the primary driver for the AD software.
 * @package AD
 */

/**
 * Define server path, used throughout all scripts.
 */
define('AD_SERVER_PATH', dirname(__FILE__));

require_once(AD_SERVER_PATH . '/pkgs/init.php');
require_once(AD_SERVER_PATH . '/pkgs/server.php');
require_once(AD_SERVER_PATH . '/pkgs/session.php');
require_once(AD_SERVER_PATH . '/pkgs/user_data.php');
require_once(AD_SERVER_PATH . '/pkgs/utils.php');
require_once(AD_SERVER_PATH . '/reports/report.php');

$cmd = strtolower(CUtils::get_param('cmd'));
switch ($cmd)
{
	case 'report':
		$report_obj = new CReport();
		$report_obj->execute();
		break;

	case 'server':
		$server_obj = new CServer();
		$server_obj->execute();
		break;

	case 'user_data':
		$user_data_obj = new CUserData();
		$user_data_obj->execute();
		break;

	case 'session':
	default:
		$session_obj = new CSession();
		$session_obj->execute();
		break;
}
